<header class="main-box-header clearfix">
    <div class="pull-right">
        <button type="button" class="btn btn-warning"> <input class="checkbox check-all" type="checkbox"
                style="display: inline-block;margin-top: -2px;vertical-align: middle;"> 全选 </button>
        <!-- <button type="button" class="btn btn-warning"> <input class="checkbox check-all" type="checkbox" style="display: inline-block;margin-top: -2px;vertical-align: middle;"> 全选 </button> -->
        <button type="button" class="btn btn-primary" id="createUrl">
            <i class="fa fa-plus"></i> 添加素材 <span class="caret"></span>
        </button>
        <button type="button" class="btn btn-primary" id="uploadTEXT" style="display: none;">
            <i class="fa fa-plus"></i> 添加 <span class="caret"></span>
        </button>
        <button class="btn btn-danger ajax-post confirm" url="{:url('del')}"
            target-form="ids">删 除</button>
    </div>
    {include file="book/_pub_search" /}
</header>
<div class="main-box-body clearfix">
    {:widget('admin/Book/book', $book_id)}
    {:widget('admin/Book/cate', $cate_type)}
</div>

<!-- 百度文案 -->
<div class="baiduTable">
    <table class="table table-hover table-bordered">
        <thead>
            <tr>
                <th  width="50px"> <input class="checkbox check-all" type="checkbox"
                  ></th>
                <th  width="80px">编号</th>
                <th width="40%">文案</th>
                <th width="220">创建人/归属人</th>
                <th>选用</th>
                <th width="140px">记录</th>
                <th>复制</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {empty name="list"}
            <tr><td colspan="9" align="center">暂无数据</td></tr>
            {/empty}
            {volist name="list" id="vo"}
            <tr>
                <td>
                    <input class="ids row-selected" type="checkbox" name="id[]" value="{$vo.id}">
                <td>
                    {$vo.id}
                </td>
                <td>
                    <div class="example" style="font-size: 17px;  color: #5c5c5c;"
                        title="{$vo.content_zh}"> 
                        {$vo.content_zh} </div>
                </td>
                <td>{$userlist[$vo['create_uid']]??$vo['create_uid']}

                     / {$userlist[$vo['uid']]??$vo['uid']}
                </td>
                <td {if $vo['selection_uid'] == 0}onclick="selection({$vo['id']})"{/if}>{if $vo['selection_uid'] == 0}<i class="fa fa-edit"></i> 未选用{else/} <span  style="color:#ff3c00">已选用</span> {/if}</td>
                <td>
                    {if $vo['selection_uid'] == 0}
                    -
                    {else/}
                    {:date("Y-m-d H:i:s", $vo['selection_time'])}<br>{$userlist[$vo['selection_uid']]??$vo['selection_uid']}选用
                    {/if}
                    
                </td>
                <td>
                    <a href="#" onclick="copyContent(`{$vo.content}`, {$vo['id']})" class="copy">
                        <span class="iconfont icon-copy"></span> 复制
                    </a>
                </td>
                <td>
                    <a href="JavaScript:;" onclick="editreferral(this)" data-json='{:json_encode($vo)}'>
                        <i class="fa fa-edit"></i> 修改
                    </a>
                    {if checkAuthRule('del')}<a href="{:url('del',array('id'=>$vo['id']))}" class="ajax-get confirm"><i class="fa fa-times"></i> 删除</a>{/if}
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
</div>
{$page}
<div class="modal fade" id="create-referral-link-modal">
	<div class="modal-dialog" role="document">
	   <div class="modal-content">
		   <div class="modal-header">
			   <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
			   <span style="font-size: 20px;"><span id="referralname">添加</span></span>
		   </div>
		   <div class="modal-body">
			   <div data-bind="visible: loading" class="loading-panel" style="display: none;">
				   <i class="fa fa-spin fa-spinner"></i>
			   </div>
			   <form class="form-horizontal modelform">
                    
                    <div class="form-group">
                        <label class="control-label col-sm-2">文案</label>
                        <div class="col-lg-8">
                            <textarea class="form-control" name="content" id="content" placeholder=""></textarea>
                        </div>
                    </div>
                    <input type="hidden" name="cate_type" value="{$cate_type}">
                    <input type="hidden" name="book_id"   value="{$book_id}">
                    <input type="hidden" name="id" id="createspreadid">
                    <div class="form-group" id="batchtxt">
                        <label class="control-label col-sm-2">批量上传</label>
                        <div class="col-lg-8">
                            <div class="picker-box">
                                <div id="picker_ebook" class="picker_button">上传文案 </div>
                                <input type="hidden" name="ebook" id="field_ebook" value="">
                                <div id="fileList_ebook" class="upload-file-list-info" >(请上传.txt文件， 1行一个文案)</div>
                            </div>
                    
                        </div>
                    </div>

			   </form>
		   </div>
		   <div class="modal-footer">
			   <button type="button" id="createreferral" class="btn btn-primary ">提交</button>
		   </div>
	   </div>
   </div>
</div>

